home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.11 Nov 95 / ODF Beeper / Include / BeeperPart.h < prev    next >
Encoding:
Text File  |  1995-09-26  |  3.5 KB  |  146 lines  |  [TEXT/MPS ]

  1. //==========================================================
  2. //    File:                BeeperPart.h
  3. //    Copyright: © 1995 by Apple Computer, Inc.
  4. //==========================================================
  5.  
  6. #ifndef BEEPERPART_H
  7. #define BEEPERPART_H
  8.  
  9. // ----- Framework Layer -----
  10.  
  11. #ifndef FWPART_H
  12. #include "FWPart.h"
  13. #endif
  14.  
  15. #ifndef FWFRAME_H
  16. #include "FWFrame.h"
  17. #endif
  18.  
  19. // ----- Foundation Layer -----
  20.  
  21. #ifndef FWHFCONN_H
  22. #include "FWHFConn.h"
  23. #endif
  24.  
  25. //==========================================================
  26. // Forward Declarations
  27. //==========================================================
  28.  
  29. #if FW_LIB_EXPORT_PRAGMAS
  30. #pragma import on
  31. #endif
  32. class FW_CLASS_ATTR FW_CNotification;
  33. class FW_CLASS_ATTR FW_CHandleFunctionConnection;
  34. class FW_CLASS_ATTR FW_CPushButton;
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma import off
  37. #endif
  38.  
  39. //==========================================================
  40. //    Forward declarations
  41. //==========================================================
  42.  
  43. class CAction;
  44.  
  45. //==========================================================
  46. //    class CBeeperPart
  47. //==========================================================
  48.  
  49. class FW_CLASS_ATTR CBeeperPart : public FW_CPart
  50. {
  51. public:
  52.     static const ODValueType kPartKind;
  53.  
  54. //----------------------------------------------------------
  55. //    Initialization/Destruction
  56. //
  57. public:
  58.     CBeeperPart(ODPart* odPart);
  59.     virtual ~CBeeperPart();
  60.     
  61.     virtual void    Initialize(Environment* ev);
  62.     
  63. //----------------------------------------------------------
  64. //    Inherited API
  65. //
  66.   public:
  67.     virtual FW_CFrame* NewFrame(Environment* ev,
  68.                             ODFrame* odFrame,
  69.                             FW_CPresentation* presentation,
  70.                             FW_Boolean fromStorage);
  71.     
  72.     virtual void InternalizeContent(Environment* ev, 
  73.                             ODStorageUnit* storage, 
  74.                             FW_CCloneInfo* cloneInfo);
  75.                                 
  76.     virtual void ExternalizeContent(Environment* ev, 
  77.                             ODStorageUnit* storage, 
  78.                             FW_CCloneInfo* cloneInfo);
  79.  
  80. //----------------------------------------------------------
  81. //    New API
  82. //
  83.   public:
  84.       CAction*            GetAction() { return fAction; }
  85.       void                SetAction(CAction* action);
  86.  
  87.   public:
  88.     void                DoAction();
  89.  
  90. //----------------------------------------------------------
  91. //    Data Members
  92. //
  93.   private:
  94.     CAction*            fAction;
  95. };
  96.  
  97. //==========================================================
  98. //    class CBeeperFrame
  99. //==========================================================
  100.  
  101. class FW_CLASS_ATTR CBeeperFrame : public FW_CFrame, 
  102.                                 public FW_MReceiver
  103. {
  104. //----------------------------------------------------------
  105. //    Initialization/Destruction
  106. //
  107. public:
  108.     CBeeperFrame(Environment* ev, ODFrame* frame, 
  109.         FW_CPresentation* presentation, CBeeperPart* part);    
  110.     virtual ~CBeeperFrame();
  111.  
  112. //----------------------------------------------------------
  113. //    FW_CFrame overrides
  114. //
  115. public:
  116.     virtual void CreateGadgetLayout(Environment* ev, 
  117.                         FW_CGadgetInitializer& initializer);
  118.  
  119.     virtual ODDragResult CanAcceptDrop(Environment* ev, 
  120.                         ODDragItemIterator* dragInfo);
  121.  
  122.     virtual void Draw(Environment* ev, 
  123.                     ODFacet* facet, ODShape* invalidShape);
  124.  
  125.     virtual void FrameShapeChanged(Environment* ev);
  126.  
  127. //----------------------------------------------------------
  128. //    FW_MReceiver overrides
  129. //
  130. public:
  131.     virtual void HandleNotification(
  132.                     const FW_CNotification& notification);
  133.  
  134. //----------------------------------------------------------
  135. //    Data Members
  136. //
  137. private:
  138.     CBeeperPart*    fBeeperPart;
  139.     FW_CPushButton*    fBeeper;
  140.     ODID            fButtonId;
  141.     FW_CHandleFunctionConnection fConnection;
  142.     ODTypeToken        fButtonNotificationToken;
  143. };
  144.  
  145. #endif
  146.